﻿using Core.Domain.Bases;
using Core.Domain.Entities;
using Core.Domain.Interfaces;
using Core.IocHelpers;

namespace DataMain.Repositories
{
  [AutoRegister]
  public class PersonRepository : EntityRepository<Person>, IPersonRepository
  {
    private readonly IPersonFinder _personFinder;

    public PersonRepository(IPersistanceRepository repository, IPersonFinder finder)
          : base(repository)
    {
      _personFinder = finder;
      _personFinder.DataSource = Query();
    }

    #region IPersonRepository Members

    public IPersonFinder Find
    {
      get { return _personFinder; }
    }

    #endregion
  }
}